package com.ias.agdis_r.volley;

import java.io.IOException;
import java.util.Map;
import org.codehaus.jackson.type.TypeReference;
import org.json.JSONObject;
import com.ias.agdis_r.manager.DataManager;

public abstract class JSONUtil {

	public static Map<String, Object> parseJsontoMap(JSONObject jsonObject) {

		return parseJsontoMap(jsonObject.toString());
	}

	public static Map<String, Object> parseJsontoMap(String jsonObject) {
		try {
			return DataManager.getInstance().getMapper().readValue(jsonObject, new TypeReference<Map<String, Object>> (){});
		} catch (IOException e) {
			e.printStackTrace();
			return null;
		}
	}
}
